Skip to content

dind: remove containerd, ctr and use embedded containerd - #585

Draft
thaJeztah wants to merge 6 commits into
docker-library:masterfrom
thaJeztah:builtin_containerd
Draft

dind: remove containerd, ctr and use embedded containerd#585
thaJeztah wants to merge 6 commits into
docker-library:masterfrom
thaJeztah:builtin_containerd

Conversation

@thaJeztah

@thaJeztah thaJeztah commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

We could even consider dropping the zfs dependency; reducing the image size we can go from 528MB -> 429MB (unpacked + content)

  • removing redundant dependencies (528MB -> 519MB)
  • removing containerd (519MB -> 471MB)
  • removing ctr (471MB -> 442MB)
  • removing zfs (442MB -> 429MB)
docker image ls dind
IMAGE           ID             DISK USAGE   CONTENT SIZE   EXTRA
dind:before     6f84404d1f9d        528MB          137MB
dind:lessdeps   7c41dc0bc569        519MB          134MB
dind:noc8d      b42924822491        471MB          122MB
dind:noctr      a6c8b5c25b14        442MB          114MB
dind:nozfs      ce720faa179a        429MB          111MB

The btrfs storage driver no longer requires the btrfs userspace
utilities at runtime.

Moby switched its btrfs implementation to use the kernel UAPI directly
in v23.0, removing its dependency on libbtrfs/btrfs-progs.

Containerd similarly switched its btrfs snapshotter to use the kernel
UAPI through containerd/btrfs/v2 in containerd 1.7, making kernel
headers a build-time dependency instead of requiring btrfs-progs at
runtime.

Remove btrfs-progs from the dind image, as neither the Moby btrfs
storage driver nor containerd's btrfs snapshotter requires it.

- moby/moby@3208dca
- containerd/containerd@52f82ac

Signed-off-by: Sebastiaan van Stijn <[email protected]>
The e2fsprogs, e2fsprogs-extra, and xfsprogs packages were runtime
dependencies of the devicemapper storage driver, providing the tools
used to create and configure ext4 and XFS filesystems.

The devicemapper storage driver was disabled by default in Docker
Engine v23.0 and removed in v25.0. None of these filesystem utilities
are required by the remaining storage drivers.

Remove e2fsprogs, e2fsprogs-extra, and xfsprogs from the dind image.

- https://docs.docker.com/engine/deprecated/#device-mapper-storage-driver

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Git was originally added explicitly to the dind variants when the
separate git variant was folded into dind.

It was later added to the CLI variants as well, to support build and
buildx workflows that invoke git. As the dind image is based on the CLI
image, git is now inherited from its parent and no longer needs to be
installed again.

Remove the redundant git package from the dind dependencies.

- docker-library@485fefe
- docker-library@b348a31

Signed-off-by: Sebastiaan van Stijn <[email protected]>
before/after:

    docker image ls dind

    IMAGE         ID             DISK USAGE   CONTENT SIZE   EXTRA
    dind:before   6f84404d1f9d        528MB          137MB
    dind:latest   5ac80767b941        436MB          112MB

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Comment thread Dockerfile-dind.template
Comment on lines +68 to +69
--exclude 'docker/containerd' \
--exclude 'docker/ctr' \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we do this, we should definitely include a comment here explaining why, probably with a pointer to something useful like moby/moby#53388 -- maybe something like this?

Suggested change
--exclude 'docker/containerd' \
--exclude 'docker/ctr' \
# exclude containerd, relying on the "embedded containerd" instead: https://github.com/moby/moby/pull/53388 (makes for a smaller image)
--exclude 'docker/containerd' \
--exclude 'docker/ctr' \

@tianon

tianon commented Sep 4, 2026

Copy link
Copy Markdown
Member

IMO, one of the biggest and most attractive benefits to the containerd integration itself is access to the containerd content store, especially being able to trivially explore/query that via ctr, so I'm honestly not a huge fan of this change (and think going the other direction and embedding dockerd inside containerd/making it a plugin instead is saner), but I don't feel strongly enough about it to block this.

@tianon

tianon commented Sep 4, 2026

Copy link
Copy Markdown
Member

(it's a very niche use case either way)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants